<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="wrap">倒计时<span class="time"></span></div>
</body>
<script>
    setInterval(function(){
        var nowTime=new Date(),
            cjTime=new Date('2023-01-01 0:0:0:')
        var time=cjTime-nowTime
        var day=Math.floor(time/1000/60/60/24),
            hours=Math.floor(time/1000/60/60%24),
            ses=Math.floor(time/1000/60%60),
            mins=Math.floor(time/1000%60)
        var str="距离春节还有"+day+"天"+hours+"小时"+ses+"分钟"+mins+"秒"
        document.getElementsByTagName('div')[0].innerHTML=str
     },1000)
</script>
</html>